<include file="header" />
<body>
<div class="wraper">
	<div class="header flex-box">
		<span class="text-center">{BEESCRM:$title}</span>
		<a href="{BEESCRM::U('base/HduWaterFee/log',array('water_fee_id'=>$water_fee_id))}" class="iconfont icon-wodejiaoyijilu text-right"></a>
	</div>
	<div class="form-box box-border">
		<p class="form-list">
			<select id="community">
				<option value="0">请选择所在生活区</option>
				<volist name="community" id="vo">
					<option value="{BEESCRM:$vo.community_id}">{BEESCRM:$vo.community_name}</option>
				</volist>
			</select>
			<span class="triangle"></span>
		</p>
		<p class="form-list">
			<select id="building">
				<if condition="$building_data">
					<option value="0">请选择楼幢</option>
					<volist name="building_data" id="vol">
						<option value="{BEESCRM:$vol.building_id}">{BEESCRM:$vol.building_name}</option>
					</volist>
					<else/>
					<option value="0">请选择楼幢</option>
					<volist name="building" id="vo">
						<option value="{BEESCRM:$vo.building_id}">{BEESCRM:$vo.building_name}</option>
					</volist>
				</if>
			</select>
			<span class="triangle"></span>
		</p>
		<p class="form-list">
			<select id="floor">
				<if condition="$floor_data">
					<option value="0">请选择楼层</option>
					<volist name="floor_data" id="vol">
						<option value="{BEESCRM:$vol.floor_id}">{BEESCRM:$vol.floor_name}</option>
					</volist>
					<else/>
					<option value="0">请选择楼层</option>
					<volist name="floor" id="vo">
						<option value="{BEESCRM:$vo.floor_id}">{BEESCRM:$vo.floor_name}</option>
					</volist>
				</if>
			</select>
			<span class="triangle"></span>
		</p>
		<p class="form-list">
			<select id="room">
				<if condition="$room_data">
					<option value="0">请选择房间</option>
					<volist name="room_data" id="vol">
						<option value="{BEESCRM:$vol.room_id}">{BEESCRM:$vol.room_name}</option>
					</volist>
					<else/>
					<option value="0">请选择房间</option>
					<volist name="room" id="vo">
						<option value="{BEESCRM:$vo.room_id}">{BEESCRM:$vo.room_name}</option>
					</volist>
				</if>
			</select>
			<span class="triangle"></span>
		</p>
		<p class="form-list">
			<select id="year">
				<option value="0">年份选择</option>
				<volist name="year" id="vo">
					<option value="{BEESCRM:$vo}" <if condition="$nowYear eq $vo">selected</if>>{BEESCRM:$vo}年</option>
				</volist>
			</select>
			<span class="triangle"></span>
		</p>
		<p class="form-list">
			<select id="month">
				<option value="0">月份选择</option>
				<volist name="month" id="vo">
					<option value="{BEESCRM:$vo}">{BEESCRM:$vo}月</option>
				</volist>
			</select>
			<span class="triangle"></span>
		</p>
	</div>
	<if condition = "$tips">
		<div class="form-box">
			<div class="form-list lineheight15">
				<p class="text-red">温馨提示</p>
				<p class="text-12">{BEESCRM:$tips}</p>
			</div>
		</div>
	</if>
	<div class="container">
		<a href="javascript:void(0);" class="btn text-center">查询</a>
	</div>
</div>
<script src="/assets/base/electricityfee/js/jquery-2.1.0.min.js"></script>
<script src="/assets/base/electricityfee/js/jq.utils.js"></script>
<script src="/assets/bower_components/sweetalert/lib/sweet-alert.min.js"></script>
<link rel="stylesheet" href="/assets/bower_components/sweetalert/lib/sweet-alert.css?v={BEESCRM:$time}">
<script src="/assets/base/common/ajaxgetroominfo.js"></script>
<script>
	$('#year').val({BEESCRM:$nowYear});
	$('#month').val({BEESCRM:$nowMonth});
	$('#community').val({BEESCRM:$community_id});
	$('#building').val({BEESCRM:$building_id});
	$('#floor').val({BEESCRM:$floor_id});
	$('#room').val({BEESCRM:$room_id});

	$(function(){
		//调用房间联动js
		ajaxgetroominfo(true, true, true);
	});
    $('.tab-prize').on('click','.option',function(){
        if($(this).hasClass('other')){
            $(this).siblings().removeClass('checked');
        }
        else{
            $(this).toggleClass('checked').siblings().removeClass('checked');
        }
    });


	$(document).on('click','.btn',function(){
		var year = $('#year').val();
		var month = $('#month').val();
		var community_id = $('#community').val();
		var building_id = $('#building').val();
		var floor_id = $('#floor').val();
		var room_id = $('#room').val();

		if(community_id == 0){
			$.alert('error','请选择生活园区');
			return false;
		}

		if(building_id == 0){
			$.alert('error','请选择楼幢');
			return false;
		}

		if(floor_id == 0){
			$.alert('error','请选择楼层');
			return false;
		}

		if(room_id == 0){
			$.alert('error','请填写寝室号');
			return false;
		}

		if(year == 0){
			$.alert('error','请选择年份');
			return false;
		}

		if(month == 0){
			$.alert('error','请选择月份');
			return false;
		}


		var str = "&year="+year+"&month="+month+"&community_id="+community_id+"&building_id="+building_id+"&floor_id="+floor_id+"&room_id="+room_id+"&flag=1";
		window.location.href="/base/?m=HduWaterFee&a=result&water_fee_id={BEESCRM:$water_fee_id}"+str;
    });
</script>
</body>
</html>